<link rel="stylesheet" href="/wp-content/themes/ifan/assets/css/fengmi3.css">
<main class="article_main">
    <div class="container article-area">
        <div class="row breadcrumbs">
            <?php	wheatv_breadcrumbs();?>
        </div>
        <div class="row">
            <div class="col-lg-9 col-md-9 col-sm-12 col-12" style="padding:0">
                <div class="slidebar-poduct-padding-l">
                    <div class="row product_canshu">
                        <div class="col-lg-5 col-md-5 col-sm-12 col-12 ">
                            <div class="product-img"><img src="<?php the_post_thumbnail_url( 'full' ); ?>" alt=""></div>
                        </div>
                        <div class="col-lg-6 col-md-6 col-sm-12 col-12 product-des">
                            <h1 class="product-title"><?php the_title(); ?></h1>
                            
                                <?php
                                echo the_field('canshu');
                                ?>

                        </div>
                    </div>
                    <article class="article-content" id="article-content">
                        <div class="product_tag_box">
                            <ul class="product_tab_ul">
                                <li class="active">产品介绍</li>
                                <li>产品评测</li>
                                <li>投影仪常见问题</li>
                                <li>售后服务</li>
                            </ul>
                            <div class="product_tab_content">
                                <div class="tab_item active">
                                    <?php
                                        the_content();

                                    ?>
                                </div>
                                <div class="tab_item">
                                    
                                <div class="related_posts">
                                    <!-- <h3>这几篇评测文章你可能也喜欢：</h3> -->
                                    <ul>
                                        <?php
                                        $post_num = 8;
                                        $exclude_id = $post->ID;
                                        $posttags = get_the_tags(); 
                                        // var_dump($exclude_id );

                                        // var_dump($posttags );
                                        $i = 0;
                                        if ( $posttags ) {
                                            $tags = ''; 
                                            wp_reset_query();

                                            foreach ($posttags as $tag) {
                                                $tags .= $tag->term_id . ','; 
                                    
                                                $args = array(
                                                'post_status' => 'publish',
                                                'tag__in' => explode(',', $tags),
                                                'post__not_in' => explode(',', $exclude_id),
                                                'caller_get_posts' => 1,
                                                'orderby' => 'comment_date',
                                                'posts_per_page' => $post_num,
                                                'cat'=>'32'
                                                );
                                                query_posts($args);
                                                while( have_posts() ) { 
                                                    the_post();
                                                    get_template_part( 'template-parts/content/content' );
                                                    $exclude_id .= ',' . $post->ID; $i ++;
                                                } 
                                                wp_reset_query();
                                            }
                                        }

                                        if ( $i == 0 ) echo '<li>没有相关文章!</li>';
                                        ?>
                                    </ul>
                                    </div>



                                </div>
                                <div class="tab_item">
                                    <!-- <h3>这几篇常见问题你可能也喜欢：</h3> -->
                                    <ul>
                                        <?php

                                        $args=array(
                                            'cat' => 91,   // 分类ID
                                            'posts_per_page' => 6, // 显示篇数
                                        );
                                        
                                        
                                        $i = 0;


                                        query_posts($args);
                                        while( have_posts() ) { the_post();get_template_part( 'template-parts/content/content' ) ?>
                                        
                                        <?php
                                        $i ++;
                                        } wp_reset_query();


                                        if ( $i == 0 ) echo '<li>没有相关文章!</li>';
                                        ?>
                                    </ul>
                                    
                                </div>
                                <div class="tab_item">
                                    

                                <?php echo the_field('shouhou')?:''?>
                                </div>
                            </div>

                        </div>
                    </article>
                <div class="article-tag">
                    <span class=""><i class="icofont icofont-tags"></i>
                        <?php the_tags('', ' ', ''); ?>
                </div>
            </div>
            <div class="page-next">
                <div class="pre">
                    <?php previous_post_link('  上一篇：   %link'); ?>
                </div>
                <div class="next">
                    <?php next_post_link('  下一篇：  %link '); ?>
                </div>
            </div>
        </div>
        <aside class="col-none col-lg-3 col-md-3  sidebar sidebar-left">
            <div id="sidebar">
                <div class="widget">
                <?php include_once(TEMPLATEPATH . "/sidebar.php"); ?>
                </div>
            </div>
        </aside>
    </div>
</main>